﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SmartSpace.Core;

namespace SmartSpace.Cwt
{
    public interface ICwtService
    {
        Company GetCompany();
        bool SaveCompany(Company company);

        bool SaveSummary(Summary summary);
        bool DeleteSummary(Summary summary);
        Summary FindSummary(Guid id);
        List<Summary> FindSummaries();

        #region category
        bool SaveCategory(Category category);
        bool DeleteCategory(Category category);
        Category FindCategory(string code);
        List<Category> FindCategories();
        #endregion

        #region article
        bool SaveArticle(Article article);
        bool DeleteArticle(Article article);
        Article FindArticle(Guid id);
        PagedList<Article> FindArticles(Guid categoryId, int start, int limit);
        PagedList<Article> FindArticles(string categoryCode, int start, int limit);
        /// <summary>
        /// 根据访问次数来查询
        /// 降序
        /// </summary>
        /// <param name="categoryId"></param>
        /// <param name="start"></param>
        /// <param name="limit"></param>
        /// <returns></returns>
        PagedList<Article> FindHotArticles(Guid categoryId, int start, int limit);
        PagedList<Article> FindHotArticles(int start, int limit);
        /// <summary>
        /// 根据顶置程度来查询
        /// 降序
        /// </summary>
        /// <param name="categoryId"></param>
        /// <param name="start"></param>
        /// <param name="limit"></param>
        /// <returns></returns>
        PagedList<Article> FindTopArticles(Guid categoryId, int start, int limit);
        PagedList<Article> FindTopArticles(int start, int limit);

        #endregion

        #region PartnerLink
        bool SavePartnerLink(PartnerLink link);
        bool DeletePartnerLink(PartnerLink link);
        PartnerLink FindPartnerLink(Guid id);
        List<PartnerLink> FindPartnerLinks();
        #endregion

        #region Contact
        bool SaveContact(Contact contact);
        bool DeleteContact(Contact contact);
        PagedList<Contact> FindContacts(string filter, int start, int limit);
        #endregion
    }
}
